﻿using System;
using System.Collections.Generic;
//
namespace PerceptiveMCAPI.Types
{
   public class campaignEepUrlStatsResults
   {
      public twitter Twitter { get; set; }
      public click Click { get; set; }
      public List<referrers> Referrers { get; set; }

      public campaignEepUrlStatsResults()
      {
         this.Twitter = new twitter();
         this.Click = new click();
         this.Referrers = new List<referrers>();
      }

      // --------------------------------------------------- twitter
      public class twitter
      {
         public int tweets { get; set; }
         public DateTime first_tweet { get; set; }
         public DateTime last_tweet { get; set; }
         public int retweets { get; set; }
         public DateTime first_retweet { get; set; }
         public DateTime last_retweet { get; set; }
         public List<tweet_status> statuses { get; set; }

         public twitter()
         {
            first_tweet = DateTime.MinValue;
            first_retweet = DateTime.MinValue;
            last_tweet = DateTime.MinValue;
            last_retweet = DateTime.MinValue;
            statuses = new List<tweet_status>();
         }

         public class tweet_status
         {
            public string status { get; set; }
            public string screen_name { get; set; }
            public string status_id { get; set; }
            public DateTime datetime { get; set; }
            public bool is_retweet { get; set; }

            public tweet_status()
            { datetime = DateTime.MinValue; }
         }
         // ------------------- ToString
         public override string ToString()
         {
            return string.Format( "Tweets: {0}, Retweets: {1}", tweets, retweets );
         }
      }
      // --------------------------------------------------- click
      public class click
      {
         public int clicks { get; set; }
         public DateTime first_click { get; set; }
         public DateTime last_click { get; set; }
         public List<location> locations { get; set; }
         // --------------------------------------------
         public click()
         {
            first_click = DateTime.MinValue;
            last_click = DateTime.MinValue;
            locations = new List<location>();
         }
         //
         public class location
         {
            public string country { get; set; }
            public string region { get; set; }
            public int clicks { get; set; }
         }
      }
      // --------------------------------------------------- referrers
      public class referrers
      {
         public string referrer { get; set; }
         public int clicks { get; set; }
         public DateTime first_click { get; set; }
         public DateTime last_click { get; set; }

         public referrers()
         {
            first_click = DateTime.MinValue;
            last_click = DateTime.MinValue;
         }
      }
   }
}